package com.group4.generator;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.group4.rbac.entity.User;
import com.group4.rbac.mapper.UserMapper;
import com.group4.rbac.service.UserService;
import com.group4.rbac.util.TimeUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * @author
 * @since 2018/12/13
 */
@Slf4j
public class CodeGenerator {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private UserService userService;

    @Test
    public void run() {


        System.out.println(TimeUtil.timeUtil());
    }
    @Test
    public void testLogin(){
//        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("username", "admin");
//        User user1 = userMapper.selectOne(queryWrapper);
//
//        log.info("查找到用户:{}",user1);
//        User admin = userService.selectUserByUsername("admin");
//        log.info("user:{}",admin);

    }
}
